package com.wtwd.campus.hxy.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wtwd.campus.hxy.dao.HxyStudentMapper;
import com.wtwd.campus.hxy.model.entity.HxyStudent;
import com.wtwd.campus.hxy.service.HxyStudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zdl
 * @since 2021-07-27
 */
@Service
public class HxyStudentServiceImpl implements HxyStudentService {

    @Resource
    private HxyStudentMapper hxyStudentMapper;

    @Override
    public int save(HxyStudent student) {
        return hxyStudentMapper.insert(student);
    }

    @Override
    public boolean deleteByImei(String imei) {
        LambdaQueryWrapper<HxyStudent> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(HxyStudent::getImei, imei);
        return hxyStudentMapper.delete(queryWrapper) == 1;
    }
}
